from applications.extensions import ma
from marshmallow import fields, validate


class CategorySchema(ma.Schema):
    categoryId = fields.Integer(attribute="id")
    parentId = fields.Integer(attribute="parent_id")
    categoryName = fields.Str(attribute="category_name")
    status = fields.Str(validate=validate.OneOf(["0", "1"]))
    remark=fields.Str(attribute="remark")
    sort = fields.Integer()
